package pl.koziolekweb.translator.engine;

import java.nio.charset.Charset;

/**
 * 
 * @author bartlomiejk
 * 
 * 
 *         $Id: EncoderImpl.java 157 2009-03-12 14:27:06Z bjkuczynski $
 */
class EncoderImpl implements Encoder {

	/**
	 * @see pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)
	 * 
	 * @param text {@link pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)}
	 * @return {@link pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String) pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)}
	 */
	public final String toISOfromUTF(final String text) {
		String out = new String(text.getBytes(), Charset.forName("ISO-8859-1"));
		return out;
	}

	/**
	 * @see pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)
	 * 
	 * @param text {@link pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)}
	 * @return {@link pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String) pl.koziolekweb.translator.engine.Encoder#toISOfromUTF(java.lang.String)}
	 */
	public final String toUTFfromISO(final String text) {
		String out = new String(text.getBytes(), Charset.forName("UTF-8"));
		return out;
	}

}
